import request from '@/utils/request'

// 查询新增挂号列表
export function listManagement(query) {
  return request({
    url: '/skx/patient/getlist',
    method: 'get',
    params: query
  })
}

//获取科室相关
export function getDepartment(query) {
  return request({
    url: '/departments/getAllChildDepartments',
    method: 'get',
    params: query
  })
}

// 查询新增挂号详细
  export function getManagement(registrationId) {
    return request({
      url: '/skx/management/' + registrationId,
      method: 'get'
    })
  }

// 新增新增挂号
  export function addManagemented(data) {
    return request({
      url: '/skx/management',
      method: 'post',
      data: data
    })
  }

// 修改新增挂号
  export function updateManagement(data) {
    return request({
      url: '/skx/management',
      method: 'put',
      data: data
    })
  }

// 删除新增挂号
  export function delManagement(registrationId) {
    return request({
      url: '/skx/management/' + registrationId,
      method: 'delete'
    })
  }

  //获取挂号费用表
export function getFee() {
  return request({
    url: '/system/guahao_charge/list',
    method: 'get'
  })
}

export function getdoctor(DepartmentId,Date){
  return request({
    url: `/em/select`,
    method: 'get',
    params: {
      departmentId: DepartmentId , // 将部门ID作为查询参数传递
      scheduledata:Date
    }
  })
}

export function getrestcount(employeeId,date) {
  return request({
    url: 'em/selectTimeByidAndDate',
    method: 'get',
    params: {
      employeeId: employeeId , // 将部门ID作为查询参数传递
      date:date
    }
  })
}

export function getphysical(visitRecordId) {
  return request({
    url:'/skx/info/' + visitRecordId,
    method: 'get'
  })
}

//
export function getRecord(visitRecordId) {
  return request({
    url: `/registration/skxmedicalrecord/${visitRecordId}`,
    method: 'get'
  })
}

export function getprescription (visitRecordId){
  return request({
    url: `/registration/skxprescriptionInfo/${visitRecordId}`,
    method: 'get'
  })
}

//成功挂号 剩余号-1
export function reduceMount(id,data) {
  return request({
    url: `/std/reduceMount` ,
    params: {
      id: id , // 将部门ID作为查询参数传递
      date:data
    },
    method: 'post',
  })
}
